package 代码随想2._4字符串;

/**
 * @author XXX
 * @date 2024-01-16 21:26
 */

/**
 * https://leetcode.cn/problems/reverse-string/submissions/496057004/
 */
public class _1反转字符串 {
    public void reverseString(char[] s) {
        int left = 0 , right = s.length - 1;
        while (left<right){
            char tmp  = s[left];
            s[left] = s[right];
            s[right] = tmp;

            left++;
            right--;
        }
        return;
    }
}

